package com.tongji.showroom.command
{
	import com.tongji.showroom.events.ReleaseProductEvent;
	import com.tongji.showroom.model.UserProductModel;
	import com.tongji.showroom.service.UserSceneService;
	
	import mx.utils.object_proxy;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenzhongyuan
	 * 2011-11-15
	 */
	
	public class ReleaseProductCommand extends Command
	{
		[Inject]
		public var event:ReleaseProductEvent;
		
		[Inject]
		public var service:UserSceneService;
		
		[Inject]
		public var model:UserProductModel;
		
		public function ReleaseProductCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case ReleaseProductEvent.RELEASE_A_PRODUCT:
					service.releaseProduct(event.obj);
					break;
				default:
					break;		
			}
		}
	}
}